//Color constants
Ti.include('DotNetNuke.js');

var viewport_bg = 'transparent'; //'#33629A';
var viewport_border = '#fff'; //'#150E2B';

//Construct main app header
var headerView = Ti.UI.createView({
	//backgroundColor: '#f00',
	top:0,
	left:0,
	height:50,
	width:320
});

var viewContainer = Ti.UI.createView({
  top: 50, //DotNetNuke.isLargeScreen() ? 50 : 60,
  width:320,
  bottom:0
});

var loading = Ti.UI.createView({
	top: 5,
	height: 50,
	right: 5
});
headerView.add(loading);

var actind = Ti.UI.createActivityIndicator({
	style:Ti.UI.iPhone.ActivityIndicatorStyle.PLAIN,
	height:10,
	width:10,
	message: 'Loading...'
});
loading.add(actind);

var infoView = Ti.UI.createView({
	top: 5,
	height: 50,
	right: 5	
});
headerView.add(infoView);

hideLoading();

function showLoading(){
	infoView.hide();
	loading.show();
	actind.show();
};

function hideLoading(){
	loading.hide();
	actind.hide();
	infoView.show();
};

// Saving this for eventual creation of profile button
/*
var profile = Ti.UI.createButton({
	backgroundImage:'images/profile-button.png',
	width:33,
	height:35,
	right:10,
	bottom:5,
	opacity:1
});
headerView.add(profile);

var username = Ti.UI.createLabel({
	color:'#92c0c3',
	text:'',
	textAlign:'right',
	height:'auto',
	font:{fontSize:16,fontWeight:'bold'},
	right:45,
	bottom:10
});
headerView.add(username);

profile.addEventListener("click",function(e) {
  Ti.App.fireEvent("profileClicked");
});
*/